package com.cms.admin.service.common.impl;

import com.cms.admin.mapper.DepartmentListMapper;
import com.cms.admin.model.DepartmentList;
import com.cms.admin.model.DepartmentListExt;
import com.cms.admin.service.common.DepartmentService;

import java.util.List;

/**
 * Created by YYY-Work on 2017/4/27.
 */
public class DepartmentServiceImpl implements DepartmentService{

    private DepartmentListMapper departmentListMapper;
    @Override
    public List<DepartmentList> getAllDepartmentList() {
        return departmentListMapper.selectAllDepartmentList();
    }

    @Override
    public List<DepartmentList> getDepartmentListByName(DepartmentListExt example) {
        return null;
    }

    @Override
    public List<DepartmentList> getDepartmentListById(DepartmentListExt example) {
        return departmentListMapper.selectByPrimaryKey(example);
    }

    @Override
    public List<DepartmentList> queryDepartmentList(DepartmentListExt search) {
        return departmentListMapper.selectByCondition(search);
    }

    @Override
    public int saveDepartmentList(DepartmentListExt record) {
        return departmentListMapper.insertSelective(record);
    }

    @Override
    public int updateDepartmentList(DepartmentListExt record) {
        return departmentListMapper.updateByPrimaryKeySelective(record);
    }


    public DepartmentListMapper getDepartmentListMapper() {
        return departmentListMapper;
    }

    public void setDepartmentListMapper(DepartmentListMapper departmentListMapper) {
        this.departmentListMapper = departmentListMapper;
    }
}
